version: '3.2'
volumes:
  pg_wallet:
services:
  wallet_db:
    image: postgres
    restart: always
    environment:
      - POSTGRES_USER=user
      - POSTGRES_PASSWORD=pass
      - POSTGRES_DB=wallet_db
    volumes:
      - pg_wallet:/var/lib/postgresql/data
    ports:
      - "127.0.0.1:5432:5432"
  app:
    restart: always
    build:
      context: .
      dockerfile: DockerFile
    ports:
      - "8080:8080"
    depends_on:
      - wallet_db
    environment:
      SPRING_DATASOURCE_URL: 'jdbc:postgresql://host.docker.internal:5432/db_wallet'
      JAVA_OPTS: '-Xmx512m'